package com.atmilan.quartz.model.dto.vietti;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Vietti商品sku源映射
 * @Description: 
 * @author Daigb
 * @date 2021-07-02
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ViettiProductSkuRes {
    
    @JsonProperty(value = "meta")
    private Meta meta;
    
    @JsonProperty(value = "data")
    private Sku sku;
    
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Meta {
        
        @JsonProperty(value = "executionTime")
        private String executionTime;

        @JsonProperty(value = "apiVersion")
        private String apiVersion;
        
        @JsonProperty(value = "items")
        private Integer items;
        
        @JsonProperty(value = "cacheHits")
        private Integer cacheHits;
        
    }
    
    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Sku {
        
        @JsonProperty(value = "productID")
        private String productId;
        
        @JsonProperty(value = "clientProductID")
        private String clientProductId;
        
        @JsonProperty(value = "spu")
        private String spu;
        
        @JsonProperty(value = "sku")
        private String sku;
        
        @JsonProperty(value = "productLastUpdated")
        private Date productLastUpdated;

        @JsonProperty(value = "sizes")
        private List<Size> sizes;

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class Size {
            @JsonProperty(value = "size")
            private String size;

            @JsonProperty(value = "stock")
            private Integer stock;

            @JsonProperty(value = "retailPrice")
            private BigDecimal retailPrice;

            @JsonProperty(value = "price")
            private BigDecimal price;

            @JsonProperty(value = "gtin")
            private String gtin;
        }
        
    }
    
}
